#!/bin/sh

dockerid=`docker ps -a --no-trunc --filter name=redis| grep -v CONTAINER | awk '{print $1}'`

if [[ -n "$dockerid" ]]; then
    docker stop $dockerid && docker rm $dockerid
fi

docker run -d \
  -p 7001:6379 \
  --restart=always \
  -m 256Mi \
  --memory-reservation 128Mi \
  --cpus 0.1 \
  --name redis \
  -e "REDIS_PASSWORD=R*d7r5-C@r" \
  redis:latest --requirepass "R*d7r5-C@r"